#ifndef STDFRECSCONT_H_
#define STDFRECSCONT_H_

#include <map>
#include <iostream>
#include "rectype.h"
#include "outformat.h"

using namespace std;
using namespace opsrc;

namespace opsrc {

    namespace stdf {

        // class declaration
        class RecBase;

        class StdfRecsCont
        {
        public:
            StdfRecsCont();
            virtual ~StdfRecsCont();

            //	RecBase* createRec(ifstream* file, stdf_rec stdfrec, std::ios::pos_type fileRecStartByteAbsolutePosition);
            bool createRec(ifstream* file, bool decodeFields);

            endian getEndian() const;
            void   setEndian(endian endi);
            void saveRecords();
            
            void setOutFormat(OutFormat*& out);

        protected:
            RecBase* implcreateRec(ifstream* file, stdf_rec stdfrec, int dataByteLength, std::ios::pos_type stdfFileRcFirstBytePosition, bool& ok);


        private:
            std::map<int, std::vector<RecBase*> > cont;
            endian edi;
            static int orderindex;
            OutFormat* of;

        };
    }

}

#endif /*STDFRECSCONT_H_*/
